package com.insigma.business.qrcode.job.consumer.impl;

import com.insigma.business.qrcode.common.converter.JobRecruitPositionTypeProviderConverter;
import com.insigma.business.qrcode.common.util.ResponseUtils;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.job.consumer.JobRecruitPositionTypeConsumer;
import com.insigma.business.qrcode.job.dto.JobRecruitPositionTypeDTO;
import com.insigma.business.qrcode.job.entity.JobRecruitPositionTypeDO;
import com.insigma.business.qrcode.job.service.JobRecruitPositionTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class JobRecruitPositionTypeConsumerImpl implements JobRecruitPositionTypeConsumer {

    @Autowired
    private JobRecruitPositionTypeService jobRecruitPositionTypeService;
    @Override
    public BaseResponse<JobRecruitPositionTypeDTO> getJobRecruitPositionTypeByCode(String code) {
        JobRecruitPositionTypeDO byCode = jobRecruitPositionTypeService.getByCode(code);
        final JobRecruitPositionTypeDTO remoteObj = JobRecruitPositionTypeProviderConverter.convertResponseDO2DTO(byCode);
        return ResponseUtils.buildSuccessResponse(remoteObj);
    }

}
